Dynomotion

Group: DynoMotion Message: 9652 From: Sam Marrocco Date: 6/12/2014
Subject: Compilation/Download clearing current positions....
I've noticed that compilation/download of c code to the kFlop causes it to clear it's current X/Y/Z locations (registers?).
While I could read them, store them, compile & download, then write them back, I'm wondering if there is a way to do that all within the compiled C Code?

i.e.

//My startup C Code
double XPos=ReadXPos();
//Do all normal startup code
SetXPos()=XPos

....or, is it too late by the time the code executes in the KFlop because the positions are already erased at the time of compile/download?

Another alternative would be to read the values and store them to a file before the previous shutdown of the app, but this would prevent going from a Mach3 session to a custom code session and remembering the values.
--

sam marrocco | chief technical officer
ringside.cutters.picnic.moonlink

248 548 2500 w
248 910 3344 c

ringsidecreative.com

Group: DynoMotion Message: 9653 From: TK Date: 6/12/2014
Subject: Re: Compilation/Download clearing current positions....
Hi Sam,

Compiling/downloading/executing a C program does not clear the Destination registers unless you have code in the C program to do so. 

By default EnableAxis() for an open loop axis sets the Destination to zero. To enable axis 0 while setting the Destination to the current Destination use:

EnableAxisDest(0,ch0->Dest);

HTH
Regards
TK

On Jun 12, 2014, at 7:22 AM, "Sam Marrocco SMarrocco@... [DynoMotion]" <DynoMotion@yahoogroups.com> wrote:

 

I've noticed that compilation/download of c code to the kFlop causes it to clear it's current X/Y/Z locations (registers?).
While I could read them, store them, compile & download, then write them back, I'm wondering if there is a way to do that all within the compiled C Code?

i.e.

//My startup C Code
double XPos=ReadXPos();
//Do all normal startup code
SetXPos()=XPos

....or, is it too late by the time the code executes in the KFlop because the positions are already erased at the time of compile/download?

Another alternative would be to read the values and store them to a file before the previous shutdown of the app, but this would prevent going from a Mach3 session to a custom code session and remembering the values.

--

sam marrocco | chief technical officer
ringside.cutters.picnic.moonlink

248 548 2500 w
248 910 3344 c

ringsidecreative.com

Group: DynoMotion Message: 9654 From: Sam Marrocco Date: 6/12/2014
Subject: Re: Compilation/Download clearing current positions....
On 6/12/2014 10:53 AM, TK tk@... [DynoMotion] wrote:
 
Hi Sam,

Compiling/downloading/executing a C program does not clear the Destination registers unless you have code in the C program to do so. 

By default EnableAxis() for an open loop axis sets the Destination to zero. To enable axis 0 while setting the Destination to the current Destination use:

EnableAxisDest(0,ch0->Dest);


That explains it!
I had cut/pasted some of the existing C-Code and dragged along and EnableAxisDest() function call that did not have the ch1->Dest argument. Patching it with that arg cured it. Thanks!

--

sam marrocco | chief technical officer
ringside.cutters.picnic.moonlink

248 548 2500 w
248 910 3344 c

ringsidecreative.com